package com.polaris.live.adapter.chatPrice

import com.blankj.utilcode.util.ColorUtils
import com.blankj.utilcode.util.SpanUtils
import com.polaris.live.common.R.color
import com.polaris.live.common.adapter.BaseBindingAdapter
import com.polaris.live.common.adapter.VBViewHolder
import com.polaris.live.databinding.AdapterBeansInstructionBinding
import com.polaris.live.resp.back_resp.InstructionVo

/**
 * BeansInstructionAdapter
 *
 * @author Created by 半仙 on 2024/1/12/012 10:16
 */
class BeansInstructionAdapter :
    BaseBindingAdapter<AdapterBeansInstructionBinding, InstructionVo>() {
    override fun convert(
        holder: VBViewHolder<AdapterBeansInstructionBinding>,
        item: InstructionVo,
    ) {
        holder.vb.apply {
            val span = SpanUtils.with(itemText)
                .append("${item.name}: ")
                .setForegroundColor(ColorUtils.getColor(color.color_FE4F3C))
                .append(item.instruction)
                .setForegroundColor(ColorUtils.getColor(color.color_202028))
                .create()
            itemText.text = span
        }
    }

}